const fs = require('fs');

function readFile(fileName) {
    return new Promise((resolve, reject) => {
        fs.readFile(fileName, (err, data) => {
            if (err) return reject(err);
            resolve(data);
        });
    });
}

async function run2() {
    let a = readFile(__dirname + '/1.txt');
    let b = readFile(__dirname + '/2.txt');
    let c = readFile(__dirname + '/3.txt');
    let arr = await Promise.all([a, b, c]);
    return arr.reduce((total, cur) => {
        return total + cur;
    });
}

run2()
    .then(data => console.log(data))
    .catch(err => console.log(err));
